package com.oracle.service;

import com.oracle.vo.Item;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class ItemService {
    private static Map<Integer, Item> map = new HashMap<>();
    static {
        map.put(1001,new Item(1001,"华为P50",5000,20));
        map.put(1002,new Item(1002,"李宁跑鞋",300,270));
        map.put(1003,new Item(1003,"java编程思想",108,30));
    }
    public Item getItem(Integer iItemNo){
        return map.get(iItemNo);
    }
    public void saveItem(Item item){
        map.put(item.getiItemNo(),item);
    }
}
